package com.baizhi.box;

/**
 * 包装类常用方法
 */
public class IntegerDemo04 {
    public static void main(String[] args) {
        Integer i = Integer.valueOf(12);

        //把包装类转换成基本数据类型
        int a = i.intValue();


        System.out.println(i); //引用数据类型
        System.out.println(a); //基本数据类型

        Double d = Double.valueOf(3.14);
        double v1 = d.doubleValue();

        //获取最值
        int max = Integer.MAX_VALUE;
        int min = Integer.MIN_VALUE;
        System.out.println(max);
        System.out.println(min);

        double maxValue = Double.MAX_VALUE;
        double minValue = Double.MIN_VALUE;
        System.out.println(maxValue);
        System.out.println(minValue);

        //将字符串转换成基本数据类型
        String s = "39";

       // Integer i2 = new Integer(s);
        int i1 = Integer.parseInt(s);

        String s2 = "3.14";
        double v = Double.parseDouble(s2);
        System.out.println(v);


    }
}
